package com.example.exception;

import com.example.common.enums.ErrorCodeEnum;
import lombok.Getter;
import lombok.Setter;

/**
 * 自定义异常类
 */
@Getter
@Setter
public class CustomException extends RuntimeException {

    // 状态码
    private String code;

    // 异常信息
    private String msg;

    public CustomException(ErrorCodeEnum errorCodeEnum) {
        this.code = errorCodeEnum.getCode();
        this.msg = errorCodeEnum.getMsg();
    }
}
